﻿#ifndef ___Class_Array2D
#define ___Class_Array2D

template <class T> class Array2D {
	T* mDatas;
	unsigned mW;
	unsigned mH;
public:
	Array2D() : mW(0), mH(0) {
		mDatas = 0;
	}
	~Array2D() {
		delete[] mDatas;
		mDatas = 0;
	}
	void setSize(unsigned w, unsigned h) {
		mW = w;
		mH = h;
		mDatas = new T[w * h];
	}
	T& operator()(unsigned x, unsigned y) {
		return mDatas[y * mW + x];
	}
};

#endif